home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / FILLPOLY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  771 b   |  33 lines

  1.  
  2.                                         /* File       : fillpoly.c */
  3.                                         /* Entered by : A. Wayner */
  4. # include <graphics.h>
  5. # include <stdlib.h>
  6.  
  7. int triangle[] = { 100, 100,   150, 50, 200, 100  };
  8. main()
  9. {
  10.     int graphdriver = DETECT, graphmode;
  11.  
  12.     int numpt;
  13.  
  14.     numpt = sizeof( triangle )/(2* sizeof( int ));
  15.  
  16.                                             /* Detect adapter type and initialize */
  17.                                             /* graphics system */
  18.     initgraph( &graphdriver, &graphmode, "\\turboc" );
  19.     outtextxy( 10, 10, "Demonstrating fillpoly");
  20.  
  21.                                             /* Use fillpoly to draw the filled figure */
  22.     setfillstyle( SOLID_FILL, LIGHTMAGENTA );
  23.     fillpoly( numpt, triangle );
  24.  
  25.                                             /* Wait until user presses a key */
  26.     outtextxy( 10, getmaxy() - 50, "Press any key to exit");
  27.  
  28.     getch();
  29.     closegraph();
  30. }
  31.  
  32.  
  33.